from django.conf.urls import url
from rest_framework_jwt.views import obtain_jwt_token
from rest_framework.routers import DefaultRouter

from . import views


urlpatterns = [
    url(r'^usernames/(?P<username>\w{5,20})/count/$', views.CheckUserNameView.as_view()),
    url(r'^phones/(?P<mobile>1[3-9]\d{9})/count/$', views.CheckPhoneView.as_view()),
    url(r'^registers/$', views.RegisterUserView.as_view()),
    # url(r'^auths/$', obtain_jwt_token),
    url(r'^auths/$', views.UserObtainJSONWebToken.as_view()),
    url(r'^infos/$', views.UserInfoView.as_view()),
    url(r'^emails/$', views.EmailSendView.as_view()),
    url(r'^emails/verification/$', views.EmailActiveView.as_view()),
    # url(r'^addresses/$', views.AddressView.as_view({'get': 'list', 'post': 'create'})),


]

router = DefaultRouter()
router.register(r'addresses', views.AddressView, base_name='address')

urlpatterns += router.urls
